import request from '@/plugins/axios'

export function fetchList(query) {
  return request({
    url: '/api/budgetparameter/page',
    method: 'get',
    params: query
  })
}

export function exportParameter(query) {
    return request({
        url: '/api/budgetparameter/export',
        method: 'get',
        params: query,
        responseType: 'blob'
    })
}

export function addObj(obj) {
  return request({
    url: '/api/budgetparameter',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/api/budgetparameter/' + id,
    method: 'get'
  })
}

export function getApply(id) {
    return request({
        url: '/api/budgetapply/' + id,
        method: 'get'
    })
}

export function delObj(id) {
  return request({
    url: '/api/budgetparameter/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/api/budgetparameter',
    method: 'put',
    data: obj
  })
}

export function putObj2(obj) {
    return request({
        url: '/api/budgetparameter/updateParameterData',
        method: 'put',
        data: obj
    })
}

export function putObj3(obj) {
    return request({
        url: '/api/budgetparameter/updateParameterData2',
        method: 'put',
        data: obj
    })
}

export function initParameter(obj) {
    return request({
        url: '/api/budgetapply/initParameter',
        method: 'post',
        data: obj
    })
}

export function updateParameter(obj) {
    return request({
        url: '/api/budgetamendapply/updateParameter',
        method: 'put',
        data: obj
    })
}

export function getParameterItem(parameterId) {
    return request({
        url: '/api/budgetparameter/getItem/' + parameterId,
        method: 'get'
    })
}

export function getParameterItem2(parameterId) {
    return request({
        url: '/api/budgetparameter/getItem2/' + parameterId,
        method: 'get'
    })
}

export function getEditHis(parameterId) {
    return request({
        url: '/api/budgetparameter/getEditHis/' + parameterId,
        method: 'get'
    })
}

export function updateBudgetParameter(obj) {
    return request({
        url: '/api/budgetparameter/updateBudgetParameter',
        method: 'put',
        data: obj
    })
}

export function updateBudgetParameter2(obj) {
    return request({
        url: '/api/budgetparameter/updateBudgetParameter2',
        method: 'put',
        data: obj
    })
}
